﻿/// <reference path="../../Ext-4.1.1a/ext.js" />

Ext.define('WeCompany.view.MainPanel', {
    extend:'Ext.tab.Panel',
    alias:'widget.mainpanel',
    flex:1,
    activeTab:0,
    initComponent: function () {
        var me = this;

        me.items = [{
            title: '文章管理',
            layout:'fit',
            id:'articlePanel'
        }, {
            title: '图片管理',
            id: 'imagePanel',
            layout: 'fit'
        }];

        //权限验证
        var roles = "." + WeCompany.Userinfo.Roles.join('.') + ".";
        if (roles.indexOf(".系统管理员.") >= 0) {
            me.items.push({
                title: "用户管理",
                layout:'fit',
                id: 'userPanel'
            });
        }

		me.callParent(arguments);
    }
});